<!--
作者: 陈圳佳
日期: 2015/8/17
时间: 15:48
-->
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@include file="../../commons/inc.jsp" %>
<div ng-controller="Edit">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">
            <span aria-hidden="true">&times;</span><span
                class="sr-only">关闭</span>
        </button>
        <h6 class="modal-title">添加客户</h6>
    </div>
    <form role="form" ng-submit="submit()">
        <div class="modal-body">
            <input type="hidden" ng-init="formConfig.action='${ctx}${action}'"/>
            <c:if test="${not empty shop}">
                <input type="hidden" ng-init="formValue.id='${shop.id}'"/>
                <input type="hidden" ng-init="formConfig.method='PUT'"/>
            </c:if>
            <div class="form-group" ng-init="formValue.shopName=${shop.shopName}'">
                <label class="control-label" for="shop-name">商品名称：</label>
                <input type="text" id="shop-name" placeholder="请输入商品名称" class="form-control input-sm" name="shopName"
                       ng-model="formValue.shopName" required>
            </div>
            <div class="form-group" ng-init="formValue.address='${shop.origin}'">
                <label class="control-label" for="origin">商品产地：</label>
                <input type="text" id="origin" placeholder="请输入商品的产地"
                       class="form-control input-sm"
                       ng-model="formValue.origin" required>
            </div>
            <div class="form-group" ng-init="formValue.phone='${shop.price}'">
                <label class="control-label" for="phone">价格：</label>
                <input type="text" id="price" placeholder="请输入价格"
                       class="form-control input-sm"
                       ng-model="formValue.price" required>
            </div>
            <div class="form-group" ng-init="frmValue.phone='${custom.phone}'">
                <label class="control-label" for="phone">联系电话：</label>
                <input type="text" id="phone" placeholder="请输入联系电话"
                       class="form-control input-sm"
                       ng-model="formValue.phone" required>
            </div>
            <div class="form-group text-center" ng-init="formValue.msg=''" style="color: red">
                <p ng-bind="formValue.msg"></p>
            </div>
        </div>
        <div class="modal-footer">
            <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
            <button type="submit" class="btn btn-primary">保存</button>
        </div>
    </form>
</div>
<script>
    globalObj.callback = function () {
        $("#customName").select2();
    }
</script>